<html>
<head><meta charset="utf-8"><title>Testing with path dependencies in library/std/Cargo.toml? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html">Testing with path dependencies in library/std/Cargo.toml?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="210638214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638214">(Sep 19 2020 at 22:25)</a>:</h4>
<p>I wanted to test building rustc with a local version of the libc crate. I added a <code>path = "..."</code> field to the dependency on <code>libc</code> in <code>library/std/Cargo.toml</code>. That resulted in this error:</p>
<div class="codehilite"><pre><span></span><code>thread &#39;main&#39; panicked at &#39;no entry found for key&#39;, src/bootstrap/lib.rs:1130:26
</code></pre></div>



<a name="210638222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638222">(Sep 19 2020 at 22:25)</a>:</h4>
<p>What's the Right Way to test rust-lang/rust with a local version of a crate?</p>



<a name="210638305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638305">(Sep 19 2020 at 22:27)</a>:</h4>
<p>Currently testing with a patch entry in the top-level <code>Cargo.toml</code>.</p>



<a name="210638363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638363">(Sep 19 2020 at 22:28)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> you want to [patch.crates-io] in Cargo.toml</p>



<a name="210638374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638374">(Sep 19 2020 at 22:29)</a>:</h4>
<p>That does seem to have gotten a little further. Now it's failing for a different reason...</p>



<a name="210638387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638387">(Sep 19 2020 at 22:29)</a>:</h4>
<p>If I specify a path dependency, that seems to result in warnings which become errors happening in that dep.</p>



<a name="210638392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638392">(Sep 19 2020 at 22:30)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error: the feature `cfg_target_vendor` has been stable since 1.33.0 and no longer requires an attribute to enable
  --&gt; /home/josh/src/rust-libc/src/lib.rs:22:13
   |
22 |     feature(cfg_target_vendor, link_cfg, no_core)
   |             ^^^^^^^^^^^^^^^^^
   |
   = note: `-D stable-features` implied by `-D warnings`
</code></pre></div>



<a name="210638446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638446">(Sep 19 2020 at 22:31)</a>:</h4>
<p>ah. for that, you can probably just deny-warnings = false in config.toml</p>



<a name="210638450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638450">(Sep 19 2020 at 22:32)</a>:</h4>
<p>I don't think we have a good solution for avoiding that</p>



<a name="210638488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638488">(Sep 19 2020 at 22:32)</a>:</h4>
<p>Is there a way to make <code>[patch]</code> not disable cap-lints?</p>



<a name="210638499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638499">(Sep 19 2020 at 22:32)</a>:</h4>
<p>I don't think so; Cargo handles that entirely, though, so it's not a rustbuild problem and I'm less aware of it :)</p>



<a name="210638510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638510">(Sep 19 2020 at 22:33)</a>:</h4>
<p>Well, I guess -- you can override to a non-local dep, e.g., a git dep I think would work too</p>



<a name="210638523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638523">(Sep 19 2020 at 22:33)</a>:</h4>
<p>so maybe you can do <code>git:///home/josh/...</code>? I forget if that works -- I know you can ssh git like that</p>



<a name="210638573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638573">(Sep 19 2020 at 22:34)</a>:</h4>
<p>I'll just disable deny-warnings, I guess.</p>



<a name="210638581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638581">(Sep 19 2020 at 22:34)</a>:</h4>
<p>I also just confirmed that the <code>.cargo/config.toml</code> mechanism for path overrides didn't work either.</p>



<a name="210638583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638583">(Sep 19 2020 at 22:35)</a>:</h4>
<p>(just didn't override the dependency at all)</p>



<a name="210638597"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638597" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638597">(Sep 19 2020 at 22:35)</a>:</h4>
<p>hm, isn't that the wrong file?</p>



<a name="210638598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638598">(Sep 19 2020 at 22:35)</a>:</h4>
<p>I thought it was .cargo/config</p>



<a name="210638607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638607">(Sep 19 2020 at 22:35)</a>:</h4>
<p>ah:</p>
<blockquote>
<p>Note: Cargo also reads config files without the .toml extension, such as .cargo/config. Support for the .toml extension was added in version 1.39 and is the preferred form. If both files exist, Cargo will use the file without the extension.</p>
</blockquote>



<a name="210638608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638608">(Sep 19 2020 at 22:36)</a>:</h4>
<p><a href="https://doc.rust-lang.org/cargo/reference/config.html">https://doc.rust-lang.org/cargo/reference/config.html</a></p>



<a name="210638609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638609">(Sep 19 2020 at 22:36)</a>:</h4>
<p>Yes, exactly.</p>



<a name="210638652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638652">(Sep 19 2020 at 22:36)</a>:</h4>
<p>hm, I am surprised by the "both files exist" bit but I guess it's necessary for backwards-compat</p>



<a name="210638659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638659">(Sep 19 2020 at 22:36)</a>:</h4>
<p>Changing <code>deny-warnings</code> seems to have worked.</p>



<a name="210638662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638662">(Sep 19 2020 at 22:37)</a>:</h4>
<p>IIRC we create the toml-less form during vendoring</p>



<a name="210638960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210638960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210638960">(Sep 19 2020 at 22:46)</a>:</h4>
<p>If I use <code>rustup toolchain link src /home/josh/src/rust/build/x86_64-unknown-linux-gnu/stage1</code>, and then use <code>cargo +src build</code> to build a crate, that'll use that local rust build's std, too, right?</p>



<a name="210669764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Testing%20with%20path%20dependencies%20in%20library/std/Cargo.toml%3F/near/210669764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Testing.20with.20path.20dependencies.20in.20library.2Fstd.2FCargo.2Etoml.3F.html#210669764">(Sep 20 2020 at 14:40)</a>:</h4>
<p>yep</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>